package Demo02;

interface Ishape{

    void draw();

    default public void func(){
        System.out.println("默认的！！！");
    }

    public static void staticfunc(){
        System.out.println("staticfunc");
    }

}

class rect implements Ishape{
    @Override
    public void draw(){
        System.out.println("矩形！！！");
    }

    @Override
    public void func(){
        System.out.println("重写默认方法！！！");
    }

}

class flower implements Ishape{
    @Override
    public void draw(){
        System.out.println("*！！！");
    }
}

public class test {
    public static void drawmap(Ishape shape){
        shape.draw();
    }

    public static void main(String[] args) {
        Ishape shape1=new rect();   //向上转型
        Ishape shape2=new flower();
        drawmap(shape1);
        drawmap(shape2);

        Ishape.staticfunc();

    }
}




